<template>
  <div class="container">
    <el-carousel :interval="4000" :type="type" :indicator-position="indicatorPosition" :height="`${ height }px`">
      <el-carousel-item v-for="item in bannerList" :key="item">
        <h3 class="medium">
          <!-- <div :style="{ backgroundImage: url(item)}"></div> -->
          <img :src="item" alt="">
        </h3>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>

  export default {
    name: 'MyCarousel',
    props: {
      bannerList: {
        type: Array | Number,
        default: 6,
      },
      height: {
        type: Number,
        default: 300,
      },
      type: {
        type: String,
        default: '',
      },
      indicatorPosition: {
        type: String,
        default: 'outside',
      }
    },
  }
</script>

<style lang="scss" scoped>

.container {
  width: 70vw;
  margin: 0 auto;
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
    img {
      width: 100%;
      // height: 100%;
      // object-fit: cover;
    }
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
}
</style>